<template>
    <div>
        <h2>修改管理员</h2>
        <div style="width:340px;text-align:center;margin:0 auto">
         
        
         <div style="line-height:60px">  账号 <el-input type="text" v-model="adminsData.account" style="width:220px;height:60px"></el-input></div>
         <div style="line-height:60px">  密码 <el-input type="text" v-model="adminsData.password" style="width:220px;height:60px"></el-input></div>
         
          
        </div>
        <button @click="updateAdmins(adminsData)">确认修改</button>
    </div>
</template>

<script>
import axios from "axios";
import { createNamespacedHelpers } from "vuex";
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
    "admins"
);
export default {
    props:['_id'],
    data(){
        return{
            adminsData:{
                
            }
        }
    },
    
    computed:{
      ...mapState(['AdminschangeData'])
    },
    watch:{
        AdminschangeData(newName, oldName){
        this.adminsData=this.AdminschangeData;
        
        },
        deep: true,
        immediate:true
    },
    created(){
        this.getAdmins();
        console.log('id',this.adminsData);
        this.getAdminsById(this._id);
    },
    
    methods: {
        ...mapActions(["getAdmins",'getAdminsById','updateAdmins']),
        
       
    },
};
</script>

<style>

</style>